home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PACKET / DOSGT114.ZIP / DOSSYS / TOOLS / DOSGATE.DOC < prev    next >
Text File  |  1989-11-29  |  22KB  |  584 lines

  1.     ╔═════════════════════════════════════════════════════════╗
  2.     ║                                                         ║
  3.     ║    DOSGATE _                                            ║
  4.     ║             \                                           ║
  5.     ║              \                                          ║
  6.     ║               \_ Remote operation of MS-DOS             ║
  7.     ║                                                         ║
  8.     ╚═════════════════════════════════════════════════════════╝
  9.     Copyright (c) 1987,1988,1989
  10.  
  11.     Rich Bono, NM1D
  12.     7 Redfield Circle
  13.     Derry, New Hampshire 03038
  14.  
  15.     This document describes DOSGATE version 1.14
  16.  
  17.     DOSGATE is a system which allows an industry standard MS-DOS computer 
  18.     to be controlled via an RS-232 serial port.  The port is considered to 
  19.     be a remote user.  The traditional console of the machine is still in 
  20.     complete control and can supervise and disable/enable the remote user 
  21.     at will.  There is a simple 'Chat' mode that may be entered from the 
  22.     console to allow 'chatting' with the remote user to give assistance or 
  23.     instructions.  In addition to chat mode, there is a simple terminal
  24.     emulator to allow control of a modem or other device connected to the
  25.     serial port.
  26.  
  27.     The remote user may be connected directly with an RS-232 terminal,
  28.     via a modem over telephone lines, or with a TNC for remote operation
  29.     via radio!
  30.  
  31.     The local console may still be used for any software 
  32.     that normally runs.  The remote user is capable of running any 
  33.     software that does only MS-DOS system calls.  Any software that 
  34.     by-passes MS-DOS and interfaces with the BIOS or directly with the 
  35.     hardware for I/O will not be usable by the remote user.
  36.  
  37.     This version of DOSGATE is being distributed as SHAREWARE.  You are
  38.     allowed to use DOSGATE on a trial basis for a limited period of time.
  39.     After the trial period, you must register your use of DOSGATE with the
  40.     author.   Remember, DOSGATE is NOT in the public domain, and as such it
  41.     is NOT free software.
  42.  
  43.     If you find DOSGATE helpful in anyway, or you wish to promote 
  44.     further improvements to DOSGATE, please send an apropriate amount 
  45.     to the author at the above address. If you send $20.00 or more, 
  46.     you will be be placed on the update list.
  47.  
  48.     Note: With this version of DOSGATE, Amateur Radio on-the-air users
  49.     of DOSGATE are NOT required to send the registration fee.
  50.  
  51.     The author would like to hear from anyone with comments or 
  52.     suggestions concerning DOSGATE or other projects.
  53.  
  54.     Currently tested with :
  55.  
  56.         Kantronix KAM (version 2.82 through 2.85)
  57.         Kantronix KPC-2 (version 2.82 or 2.85)
  58.         AEA PK-88 (release 16.May.89)
  59.  
  60.     DOSGATE is implemented as an MS-DOS installable device driver.
  61.  
  62.     Also implemented is a simple terminal emulator which allows one
  63.     to communicate with the serial port.
  64.  
  65.     To use the terminal emulator, execute DOSGATE at the DOS
  66.     prompt (you will need to rename DOSGATE.SYS to DOSGATE.EXE).
  67.  
  68.     The terminal emulator has one command:
  69.  
  70.     ALT-X - exits the terminal emulator and returns to MS-DOS.
  71.  
  72.     Device driver installation instructions:
  73.  
  74.     DOSGATE has but four runtime commands:
  75.  
  76.         ALT-D will toggle the remote user on and offline.  A message
  77.         is sent to the console and the remote user to inform about
  78.         the change.
  79.  
  80.         ALT-T will toggle the 'terminal' function on/off.  A message
  81.         is output to confirm the change in mode.  This terminal is
  82.         only to be used for simple configuration commands to or from
  83.         the TNC or modem.
  84.  
  85.         ALT-C will toggle the 'chat' function on/off.  A message is
  86.         output to both the console and the remote user to inform
  87.         about the change.  Use this mode to 'talk' to a remote user
  88.         that is connected to the system.
  89.  
  90.         ALT-M will toggle the display of 'monitored' packets to the
  91.         screen on/off.  If the TNC is left in MON ON mode, then monitor
  92.         mode will allow the display of information to be displayed
  93.         on the screen.  Note: This could cause some trouble with
  94.         certain TNC's.  If you see erratic operation of DOSGATE, try
  95.         both turning MON OFF on the TNC, and leave the DOSGATE monitor
  96.         mode off.
  97.  
  98.         
  99.  
  100. DOSGATE should be installed as any other MS-DOS device
  101.         driver. It also provides for various options.
  102.  
  103.     
  104.     CONFIG.SYS should contain the line:
  105.  
  106.         DEVICE = DOSGATE.SYS
  107.  
  108.             This causes the following default options:
  109.  
  110.                     Remote user disabled,
  111.                     Remote user with echo,
  112.                     1200 baud,
  113.                     No handshaking,
  114.                     DOSGATE on COM1,
  115.                     No Carrier Detect logic
  116.                     No SET USER= logic
  117.  
  118.             The following options are available at boot time . . .
  119.  
  120.             /R - Remote user enabled at boot time
  121.  
  122.             /E - Disable ECHO of remote users keystrokes
  123.                 This is useful if the remote users
  124.                 terminal has local echo.
  125.  
  126.             /2 - Selects COM2 for DOSGATE else COM1 is used
  127.  
  128.             /C - Carrier Detect logic, will do the following when
  129.  
  130.                 CD goes TRUE:  then execute:
  131.                      CTRL-C, ' START', CR,
  132.                 CD goes FALSE: then execute:
  133.                      CTRL-C, ' END', CR,
  134.  
  135.                 Remote user must be enabled!
  136.  
  137.                 This allows the programs 'START' and 'END'
  138.                  to be executed as remote users come and go.
  139.                   Note: If you don't need these programs,
  140.                         just copy the DUMMY.COM file to the
  141.                         name of the programs that are not
  142.                         needed.
  143.  
  144.             /U - Sets the environment variable USER to the ID of
  145.                 the user from the TNC status message.  The
  146.                 user's input is stored in the USER
  147.                 environment.  Note: FORCES the /C switch on
  148.                 (see above).  Outputs a TRANS to put TNC
  149.                 into TRANSPARENT mode.
  150.  
  151.             /Bxx - selects baud rate (defaults to 1200 baud)
  152.                 ie:
  153.                     
  154.                     /B96 - 9600 baud
  155.                     /B48 - 4800 baud
  156.                     /B24 - 2400 baud
  157.                     /B12 - 1200 baud
  158.                     /B60 - 600 baud
  159.                     /B30 - 300 baud
  160.                     /B11 - 110 baud
  161.  
  162.  
  163.             /H - Enables hardware handshaking - Must have DSR & CTS
  164.                 to be able to transmit to remote
  165.  
  166.             /A - Absorb LF's that follow CR's to remote.
  167.                 this is useful if the remote users terminal
  168.                 automatically does a CR/LF upon receiving a CR.
  169.  
  170.             /P - Enables Packet radio specific options
  171.                 ie:
  172.                     Remote user enabled at boot time
  173.                     Remote user Echo disabled
  174.                     Absorb LF's following CR's to remote
  175.                     Enable hardware handshaking
  176.                     Carrier detect logic enabled
  177.                     SET USER= logic enabled
  178.  
  179.     for example:
  180.  
  181.         DEVICE=DOSGATE.SYS /R /E   - Start remote user enabled, and
  182.                         absorb (disable) ECHO to the
  183.                         remote user.
  184.             or
  185.  
  186.         DEVICE=DOSGATE.SYS /P      - Start DOSGATE for packet radio
  187.                                      operation.
  188.  
  189.     DOSGATE should be the only device driver installed for the CON:
  190.     device.  This means DO NOT install an ANSI.SYS device driver at
  191.     the same time.
  192.  
  193.     Note: At this time, DOSGATE does not support ANSI escape sequences
  194.     to the local console.  ANSI escape sequence support is planned for
  195.     a later version (Be sure and register if you desire this).  Escape
  196.     sequences will work on a remote terminal if it understands them.
  197.  
  198.     When used as a terminal emulator DOSGATE allows the choice of baud
  199.     rate to be used.
  200.  
  201.     ie: DOSGATE /b96    - This would start the terminal emulator using 
  202.                   9600 baud over COM1.
  203.  
  204.     Note: To use the DOSGATE program as a simple terminal emulator, you
  205.     must rename DOSGATE.SYS to DOSGATE.EXE.  Or you may copy DOSGATE.SYS
  206.     to some other name with the .EXE extention (such as DG.EXE).
  207.  
  208.     Environment variables are used to assist MS-DOS programs executing
  209.     in the DOSGATE environment.  The currently defined evironment is:
  210.  
  211.         USER    - Set by DOSGATE driver to the ID of the user.
  212.                Used by DOSMAIL functions and START.
  213.  
  214.         DRIVES    - Used by END.EXE, must be set by AUTOEXEC.BAT
  215.  
  216.         MSG    - The disk drive and subdirectory in which the DOSMAIL
  217.                and USER.LOG files are stored.  Must be set by
  218.                AUTOEXEC.BAT.  Used by DOSMAIL functions and
  219.                START.
  220.  
  221.         SYSTEM    - The name of the system.  Used by DOSMAIL.  Must be
  222.                set by AUTOEXEC.BAT.
  223.  
  224.         SYSOP    - Used by TALK.EXE to inform the remote user of the
  225.                name of the person running this DOSGATE node.
  226.                Set by AUTOEXEC.BAT
  227.  
  228.  
  229.     The additional programs, "START.EXE", "END.EXE", "DISC.EXE" are
  230.     used for helping with managing the user in DOSGATE.
  231.  
  232.     With this version:
  233.  
  234.         Note: Don't try and run START or END unless DOSGATE is
  235.         installed, if you do, your system will crash or hang!
  236.  
  237.         START - Can be invoked (see above) automatically.
  238.  
  239.             START will:
  240.  
  241.             1: Open the file 'user.log' in the directory
  242.                specified by the environment 'MSG', and write
  243.                the contents of the environment 'USER' to that file.
  244.  
  245.             2: Reset the drives listed in the DRIVES environment
  246.                variable (see END below for more information).
  247.  
  248.             3: Enable output to the remote user.
  249.  
  250.             4: Look for a file called "WELCOME.DOC" and
  251.                output it to the user.  This can be to give the
  252.                user instructions when he first connects.
  253.  
  254.             5: Invoke 'READ /c' to report if the user has any mail.
  255.  
  256.             6: Invoke the file BEGIN.EXE or BEGIN.BAT if it exists
  257.                in the same directory as the START.EXE file.
  258.  
  259.         END - Can be invoked (see above) automatically.
  260.  
  261.             1: END will look in the environment for the
  262.                'DRIVES' parameter.  This is used to set each
  263.                drive to its ROOT ('\') directory, and also to
  264.                leave the machine with the default drive set as
  265.                indicated.  This is used to insure that the
  266.                next user will come into DOSGATE at the same
  267.                place each time, and not where the last user
  268.                left off.  Note: The current directory is also set
  269.                to it's root.
  270.  
  271.                DRIVES should be set in AUTOEXEC.BAT as follows:
  272.  
  273.                 SET DRIVES=C:;A:;B:;D:
  274.  
  275.                This would set each drive (A:, B:, C:, and D:) to its
  276.                root directory, and also set the default drive to
  277.                C: (the first drive specified will be the default
  278.                drive).
  279.  
  280.             2: END will invoke the file STOP.EXE or STOP.BAT if it
  281.                exists in the same directory as the END.EXE file. 
  282.  
  283.             3: Disable output to the remote user.
  284.  
  285.         DISC - Must be invoked manually.
  286.  
  287.             At this time, DISC will
  288.  
  289.                 wait 3 seconds,
  290.                 issue 3 control-C's,
  291.                 wait 3 seconds.
  292.                 issue 'DISC' [CR],
  293.                 issue 'TRANS' [CR]
  294.  
  295.             This is to place the TNC in command mode, issue
  296.             a disconnect request, then place the TNC back into
  297.             TRANSPARENT mode until the disconnect is done.
  298.             The user may use this command to have DOSGATE initiate
  299.             the disconnect.
  300.  
  301.     The DOSMAIL system:
  302.  
  303.         SEND.exe - 'Sends' mail to the designated party, if receiver of
  304.                 mail is not specified, the sender is
  305.                 prompted.  The sender ID is from the
  306.                 environment USER.  If USER is not
  307.                 available from the environment, then
  308.                 the sender is prompted for his ID.  The
  309.                 user can then specify a subject, and
  310.                 then enter his message.  Send
  311.                 terminates with a CTRL-Z or /EX at the
  312.                 begining of a line.  The mail is stored
  313.                 in the MSG subdirectory in the file
  314.                 xx.MSG, where xx is the number of the
  315.                 message in HEX.
  316.  
  317.  
  318.             ie:    SEND NM1D - To send a message to NM1D.
  319.  
  320.  
  321.         READ.exe - 'Reads' mail send to the current user.  The current 
  322.                 user is defined by the environment USER.  If 
  323.                 USER is not found or specified on the command 
  324.                 line, then the invoker is asked to supply the 
  325.                 required ID.  If there is any mail waiting for
  326.                 the user, it is presented to the user, one 
  327.                 message at a time.  At the end of each message
  328.                 the user is given the chance to delete 
  329.                 the message.  Optionally, 'READ /c' will 
  330.                 check the MSG directory for a mail file to the 
  331.                 current USER, or if USER is not found, the 
  332.                 invoker is prompted for an ID.
  333.  
  334.  
  335.             ie:    READ      - To read mail addressed to the 
  336.                         environment USER.
  337.  
  338.                 READ /c      - To check for mail addressed to the
  339.                         environment USER.
  340.  
  341.                 READ NM1D - To read possible mail for NM1D.
  342.  
  343.                 READ 21   - To read message number 21.
  344.  
  345.         LIST.exe - 'Lists' all (*.msg) files stored in the environment 
  346.                 MSG directory (INDEX.MSG).  This is to allow 
  347.                 the user to see what pending mail files exits.
  348.  
  349.             ie:
  350.                 LIST           - To list all mail TO, FROM,
  351.                          the current user, or to ALL
  352.  
  353.                 LIST NM1D      - To list all mail for NM1D
  354.  
  355.                 LIST ALL       - To list mail addressed to ALL
  356.  
  357.                 LIST /FNM1D    - To list all mail (F)rom NM1D
  358.  
  359.                 LIST /TNM1D    - To list all mail (T)o NM1D
  360.  
  361.                 LIST /SDOSGATE - To list all mail that has the
  362.                                  word 'DOSGATE' in the subject
  363.                                  field.
  364.  
  365.  
  366.         If the 'sysop' desires some other functions to be performed
  367.         when a user first connects to DOSGATE, just create your own
  368.         program to perform the desired actions, it can replace the
  369.         current START.EXE (.EXE, or .COM).  The END (.EXE, or .COM)
  370.         program is called when a user disconnects.  This may also be
  371.         replaced.  If the 'sysop' desires nothing to be done for
  372.         connect/disconnect, and will not be using mail, then the 'CD'
  373.         logic may be disabled.  If the 'sysop' desires connect
  374.         action, but nothing upon disconnect, then simply replace the
  375.         END program with one that does nothing (ie: copy DUMMY.COM to
  376.         END.COM).
  377.  
  378.  
  379.         TALK.exe - Allows the remote user to attempt to contact the
  380.                 sysop for keyboard-to-keyboard communication.
  381.                 The sysop is informed of the ID of the remote
  382.                 user.  Either can abort the 'talk' session by
  383.                 sending a CTRL-Z.
  384.  
  385.  
  386.     Compatibility with DOSGATE:
  387.  
  388.     The general rules for programs that can be run under DOSGATE are
  389.     fairly simple, not keeping to the rules may simply cause confused
  390.     users, or could cause the system to HANG!
  391.  
  392.  
  393.     1 - Any program that affects the serial port that DOSGATE is using
  394.     for the remote user will probably cause the computer to hang!
  395.     DOSGATE is using the serial port with interupts ON, and will probably
  396.     not tolerate other programs touching the serial port hardware.
  397.  
  398.     2 - Any program that does not do its I/O through DOS calls will
  399.     probably by-pass the remote user.  This means that the remote user
  400.     will probably be able to start such a program, and all may appear
  401.     normal on the local console, but the computer may appear dead as
  402.     far as the remote user is concerned.
  403.  
  404.     3 - Any program that issues ANSI escape sequences may work for the
  405.     remote user (if his terminal supports the proper escape sequences),
  406.     but (with the current version of DOSGATE) will not work correctly on
  407.     the local console (another reason to register with the author).
  408.  
  409.     4 - Programs that output massive amounts of data may run slow.
  410.     Remember that any data that is output to the remote user is limited
  411.     in speed by the serial port, (1200 baud is about 120 characters per
  412.     second, this means that is will probably take more than 16 seconds
  413.     to output 1 screen worth of data).
  414.  
  415.  
  416.     5 - At this time, if the remote user sends too much data to DOSGATE
  417.     and the current program cannot keep up with the user, some data may
  418.     be lost.  There are future plans for input handshaking (XON/XOFF or
  419.     hardware handshaking).  There is output hardware handshaking (CTS).
  420.     Basically, if the user remembers to enter a RETURN character every
  421.     80 characters or so, there should be no problem.
  422.  
  423.  
  424.     6 - It is NOT recommended that BATCH (.BAT) file be used under DOSGATE.
  425.     This is because BATCH files will not be ended by a control-C, but upon
  426.     receiving a control-C, they prompt the user to determine if the batch
  427.     file should be ended.  This operation will not allow the DOSGATE
  428.     utilities (START, and END) to operate properly.
  429.  
  430.     Special notes for TNC users:
  431.  
  432.     There are various TNC parameters that are very important for
  433.     succesful use of DOSGATE.  DOSGATE is not very smart as far as the
  434.     TNC is concerned.  This is not an accident or an afterthought!
  435.     Since DOSGATE performs FEW TNC COMMANDS then it should be compatible
  436.     with virtually ALL TNCs that have a few minor qualifications.
  437.  
  438.     The TNC MUST:
  439.  
  440.         1 - Have its RS-232 Data Carrier Detect (DCD, pin 8) go
  441.             true when a user connects, and go false when a
  442.             user disconnects.  This also means the your
  443.             RS-232 cable must include the DCD line.  Most
  444.             cables designed for a modem have all the nessary
  445.             lines (also important is the CTS and DSR line).
  446.  
  447.         2 - Be set stay in 'command' mode when the user
  448.             connects.  The TNC *MUST* output
  449.             *** CONNECTED to callsigns CR.
  450.             For Kantronix TNCs the following parameters
  451.             are important (other TNC's must set equivilent
  452.             parameters):
  453.              NOMODE ON    (stay in command mode upon connect)
  454.              NEWMODE OFF  (don't go to command mode on disconnect)
  455.              COMMAND $03 (character to place TNC into command mode)
  456.              CMDTIME 1    (wait for 1 second delay before COMMAND)
  457.              BBSMSG ON    (special format of some messages)
  458.              PARITY 4     (NONE)
  459.              8BITCONV ON  (8 bit characters)
  460.              RING OFF     (no Bell when user connects)
  461.  
  462.             The following settings are also desirable:
  463.  
  464.                 AX25L2V2 ON
  465.                 CHECK 10 - Or some other value (not 0)
  466.                 FLOW OFF
  467.                 MRPT ON
  468.                 MCOM OFF
  469.                 MON OFF  (can be MON ON if desire monitor mode)
  470.                 NUCR 0
  471.                 NULF 0
  472.                 PACTIME 10
  473.                 RELINK OFF
  474.                 SENDPAC $0D
  475.                 TRFLOW OFF
  476.                 TXFLOW OFF
  477.                 CSTAMP OFF (may be ON if no problems show)
  478.                 DAYTIME xxxxxxxxxxxx (set to correct time)
  479.  
  480.  
  481.         3 - Be set to allow only ONE user to connect at a time on
  482.             ONE stream.
  483.                 USERS 1    (note: KAM & KPC4 set 'USERS 0' to
  484.                                   be sure only one user at a
  485.                                   time can connect)
  486.  
  487.         4 - Issue a '*** CONNECTED to CALL' message terminated with
  488.             a Carriage Return when the user first connects.  Where
  489.             CALL is the id of the user who connects.  The syntax of
  490.             this message is crutial to the operation of the user id
  491.             logic of DOSGATE.  Every space and the case of the
  492.             characters (up to the CALL) is very important.  If
  493.             DOSGATE does not find this message when a user logs in
  494.             it will not function properly.
  495.             Carrier Detect must go TRUE before the CR.
  496.             Note: The connect message can be either one of the 
  497.                   following two messages:
  498.                     "*** CONNECTED to CALLSIGN"
  499.                                or
  500.                     "*** CONNECTED TO CALLSIGN"
  501.  
  502.             Data after the callsign is OK and will be part of the
  503.             environment USER= string.
  504.  
  505.         5 - Go into transparent mode when the command TRANS is issued
  506.             followed by a return.
  507.  
  508.         6 - Be set for hardware handshaking.  At this time, DOSGATE
  509.             only supports hardware handshaking.  This does not mean
  510.             that DOS's XOFF handshaking will not work.
  511.  
  512.  
  513.     DOSGATE hints:
  514.  
  515.         DOSGATE does not perform any machine protection. This means
  516.     that if a remote user decides to erase a file or format your hard disk
  517.     he WILL be able to do so!!! Unless you take steps to insure that he
  518.     is unable to perform these dasterdly deeds!  If you can trust ALL
  519.     remote users, then you need not be concerned with this.  Although(!),
  520.     if you are allowing the general public access to your machine, then
  521.     you may want to do the following:
  522.  
  523.         Create 'Hidden' directories which contain programs or data
  524.         that you don't want the casual user to stumble across.
  525.  
  526.         Set the Read Only attribute on any files that you don't want to
  527.         be easily erased.
  528.  
  529.         Do NOT keep a copy of your format (or any similarly dangerous
  530.         software) ANYWHERE on your machine.
  531.  
  532.         Use CED (or another similar DOS extention) to allow you to
  533.         remove or rename internal DOS commands so that the remote user
  534.         cannot DELete files, set the PATH, or look at environment
  535.         variables.  I use CED and map commands that I don't want the
  536.         user to perform to a non existant command, this way when the
  537.         user types the command DEL *.*, instead of the prompt "are you
  538.         sure? ", he is greeted with the message "Invalid command or
  539.         file name"! After trying a few destructive commands, the user
  540.         gives up, thinking that they have all been removed!
  541.  
  542.         Keep only software that you desire to gain access to on the
  543.         machine.  This way, if a user does destroy something, it will
  544.         not be anything important.
  545.  
  546.         You also may NOT want to leave any compilers around! This
  547.         will keep a *smart* user from connecting to your machine
  548.         and writing a simple program while online to destroy the
  549.         contents of your disks!!!
  550.  
  551. Revisions:
  552.  
  553.     1.10    Changed START, END, to enable and disable the output to
  554.         the remote user.  Also changed the DOSGATE driver to accept
  555.         commands from START and END.   This removes the extra prompts
  556.         that the user sees when first connecting.  START2, and END2
  557.         support is also removed for this reason.
  558.  
  559.     1.11    Changed DOSGATE driver to issue a TRANS command to put the
  560.         TNC into transparent mode when a user connects.  This is to
  561.         allow DOSGATE to function with TNC's that don't output the
  562.         connected message before going into command mode.  Now MUST
  563.         have TNC set to NOMODE ON, CONMODE can now be left as
  564.         desired.
  565.  
  566.     1.12    Changed DOSGATE driver to accept output commands, and changed
  567.         END to send 3 CTRL-C's to put TNC back in command mode.  This
  568.         was to support AEA-PK88, which did NOT go back into command
  569.         mode when NEWMODE was ON (NEWMODE was ignored when NOMODE was
  570.         ON in the AEA).  Added monitor command (ALT-M) which, allows
  571.         the display of monitored packets to be displayed on the screen
  572.         when a user is not connected.
  573.  
  574.     1.13    Added code to cause prompt to reappear after ALT-command to
  575.         DOSGATE driver.  This also satisfied read and cured problem
  576.         with having to hit a key after entering a command.
  577.  
  578.     1.14    Changed default settings of internal user_chk, to allow
  579.         non-packet environments to work.  Changed START to check for
  580.         READ.EXE before executing READ /c.
  581.  
  582.     Notes:
  583.         MS-DOS is a trademark of Microsoft Corporation
  584.